#pragma once
#include "cocos2d.h"
#include "TurtleManage.h"
#include "RankLayer.h"
#include "MarkLayer.h"
#include "TipLayer.h"
#include "ExitLayer.h"

using namespace cocos2d;

class PlayLayer: public Layer
{
	ExitLayer* _exitLayer = nullptr;

	TurtleManage* turtleManage;
	RankLayer* rankLayer;
	MarkLayer* markLayer;
	TipLayer* tipLayer;
	void Timer_Tick(float dt);
	virtual void onKeyReleased(EventKeyboard::KeyCode keyCode, Event* event);

public:
	PlayLayer();
	~PlayLayer();

	virtual bool init();
	static Scene* createScene();
	static PlayLayer* thisLayer;

	void playCard(int cardID);
	void playCard(int colorCardID, int cardID);

	bool checkCardEnable(int cardID);
	int* getLastTurtles();
	void startRound();
	void pauseRound();
	void continueRound();
	void nextPlayer();
	void reShuffle();
	void gameOver();

	CREATE_FUNC(PlayLayer);
};

